package cc.rengu.redp.bizimpl.upmp.service;

import cc.rengu.redp.bizimpl.enums.ChannelTypeEnum;
import cc.rengu.redp.bizimpl.upmp.domain.UpmpMenu;
import cc.rengu.redp.bizimpl.upmp.vo.UpmpMenuVO;
import cc.rengu.redp.common.domain.QueryRequest;
import cc.rengu.redp.common.exception.RedpException;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
 * @author System
 */
public interface IUpmpMenuService extends IService<UpmpMenu> {

    List<UpmpMenu> findUserPermissions(String userId);

    List<UpmpMenu> findUserMenus(String userId);

    Map<String, Object> findMenus(UpmpMenuVO menu);

    List<UpmpMenu> findMenuList(UpmpMenuVO menu);

    void createMenu(UpmpMenu menu);

    void updateMenu(UpmpMenu menu) throws Exception;

    /**
     * 递归删除菜单/按钮
     *
     * @param menuIds menuIds
     */
    void deleteMeuns(String[] menuIds) throws Exception;

    Map<String, Object> findMenusNoCommon(UpmpMenuVO menu) throws RedpException;

    String findMenuUrl(String menuName);
    /**
     * 判断请求渠道类型
     * @param request
     * @return
     */
    ChannelTypeEnum getChannel(String userType, HttpServletRequest request);

    public IPage<UpmpMenuVO> findPermsPageList(UpmpMenuVO user, QueryRequest request) throws RedpException;

    public IPage<UpmpMenuVO> permsPrivilegePageList(UpmpMenuVO user, QueryRequest request) throws RedpException;
}
